
use serde::{Deserialize, Serialize, Deserializer};
use serde::de::Error;

pub mod worker;
pub mod jobs;
pub mod sector;
pub mod pledge;
pub mod types;
pub mod storage;

#[derive(Debug, Serialize, Deserialize)]
pub struct JsonRpcError {
    pub code: u32,
    pub message: String,
    pub data: String,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct JsonRpcResponse<T> {
    pub id: u32,
    pub jsonrpc: String,
    pub result: Option<T>,
    pub error: Option<JsonRpcError>,
}

#[derive(Debug, Serialize, Deserialize)]
#[serde(rename = "SectorID")]
pub struct SectorId {
    #[serde(rename = "PascalCase")]
    pub miner: u64,
    #[serde(rename = "PascalCase")]
    pub number: u64,
}